<!-- 模板文件 -->
<script type="text/javascript">
jQuery(function(){
	//换颜色
	jQuery('#colorChange span').click(function(){
			alert('此模块暂不支持更改颜色');
		});
});
</script>

<div id="saveToDatabase">

  <div class="modl">
      
      <div class="f100-hd">
          <h3>
          	<a href="http://shop<?php echo $_SESSION["shopid"];?>.taobao.com/?search=y" title="查看所有宝贝">查看所有宝贝&gt;&gt;</a>
          </h3>
      </div>
      <div class="f100-bd">
      
      <ul class="lv1 clearFix">
          <?php 
          $_k = 0;
          $min_line = 6;
		  $_count = count($test_cats);
		  foreach($test_cats as $key=>$val){
               echo '<li>';
               echo '<dl class="lv2 clearFix">';
               echo '<dt><a href="http://shop'.$_SESSION["shopid"].'.taobao.com/search.htm?search=y&scid='.$key.'&queryType=cat" class="f100-m" target="_blank">'.$val['name'].'</a></dt>'; 
                  if(count($val) > 1){
                      foreach($val['sub'] as $k=>$v) :
                           echo '<dd><a href="http://shop'.$_SESSION["shopid"].'.taobao.com/search.htm?search=y&scid='.$k.'&queryType=cat" target="_blank">'.$v.'</a></dd>';
                      endforeach;
                  }
               echo '</dl>';
               echo '</li>';
			   unset($test_cats[$key]);
			   $_k++;
			   if($_k >= $min_line) break;
           }
		  $d_value = $min_line - $_count;
		  if($d_value > 0){
			  for($i=0;$i<$d_value;$i++){
				  echo '<li><dl class="lv2 clearFix"></dl></li>';
				  }
			}
			
          ?>
          </ul>

    </div>
    
</div>


</div> <!-- //saveToDatabase -->

<?php
	$data2['test_cats'] = $test_cats;
	$data2['vertical'] = 'horizontal';
	$this->load->view('keyboard_category_view',$data2);
?>